<!DOCTYPE html>
<html lang="en"  xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>ListOrders</title>
    <link rel="StyleSheet" href="../css/jpetstore.css" type="text/css" media="screen"/>
    <script type="text/javascript" src="/static/js/jquery-3.6.0.min.js"></script>
</head>
<body>
<div th:replace="common/Header :: header"></div>
<div id="Content">
<h2>My Orders</h2>

<table>
    <tr>
        <th>Order ID</th>
        <th>Date</th>
        <th>Total Price</th>
    </tr>
    <tr th:if="${session.orderList}==null" >
        <b th:text="${session.message}"></b>
    </tr>
<!--    <c:if test="${sessionScope.orderList==null}">-->
<!--        <b>${sessionScope.messsage}</b>-->
<!--    </c:if>-->
    <tr th:if="${session.orderList}!=null" th:each="order:${session.orderList}">
        <td th:text="${order.orderId}">

        </td>
         <td th:text="${order.orderDate}">
         </td>
        <td th:text="${order.totalPrice}"></td>
    </tr>
<!--    <c:if test="${sessionScope.orderList!=null}">-->
<!--        <c:forEach var="order" items="${sessionScope.orderList}">-->
<!--            <tr>-->
<!--                <td>-->
<!--                    <%&#45;&#45; todo 下面这个是购物车功能的 还没做 可以点&#45;&#45;%>-->
<!--                    <a href="viewOrderFromOrderList?orderId=${order.orderId}"> ${order.orderId}</a>-->
<!--                </td>-->
<!--                <td><fmt:formatDate value="${order.orderDate}"-->
<!--                                    pattern="yyyy/MM/dd hh:mm:ss"/></td>-->
<!--                <td><fmt:formatNumber value="${order.totalPrice}"-->
<!--                                      pattern="$#,##0.00"/></td>-->
<!--            </tr>-->
<!--        </c:forEach>-->
<!--    </c:if>-->
</table>
</div>
<div th:replace="common/Footer :: footer"></div>
</body>
</html>